<?php
$this->breadcrumbs = array(
	'材料单据列表' => array(
		'index'
	),
	'管理',
);

$this->userActions = array(
	//array('label'=>'三级账列表', 'url'=>array('index')),
	array(
		'label' => '新建单据',
		'url' => array(
			'create'
		)
	),
);

?>

<h1>管理材料单据</h1>
<?php $this
	->widget('zii.widgets.grid.CGridView',
		array(
			'id' => 'material-receipt-grid',
			'dataProvider' => $model->search(),
			'filter' => $model,
			'columns' => array(
				//'id',
				array(
					'name' => 'projectId',
					'type' => 'raw',
					'value' => '$data->project->name',
					'filter' => CHtml::listData(Project::getAll(), 'id', 'name')
				),
				'receiptDate',
				'token',
				array(
					'name'=>'merchantId',
					'type'=>'raw',
					'value'=>'$data->merchant?$data->merchant->name:""'
				),
				'handler',
				'note',
				array(
					'name'=>'type',
					'type'=>'raw',
					'value'=>'$data->getDisplayType()'
				),
				'processingCost:currency',
				'transportationCost:currency',
				'discount:currency',
				'otherCost:currency',
				array(
					'name' => 'warehouseManagerId',
					'type' => 'raw',
					'value' => '$data->warehouseManager->fullName',
					'filter' => CHtml::listData(
						Employee::findAllByTag('MATERIAL_WAREHOUSE_MANAGER'), 'id', 'fullName')
				),
				'priceCheckable',
				'createTime',
				/*'createUserId',
				'updateTime',
				'updateUserId',
				 */
				array(
					'class' => 'CButtonColumn',
				),
			),
		));
?>
